import { check_type, plan_state, is_handled } from '@/plugins/mate.js'

export const column = [
    {
        label: '设备名称',

        name: 'device_name',
    },

    {
        label: '巡检频率',
        name: 'cycle',
        width: '100px',
    },
    {
        label: '计划标题',
        name: 'title',
    },

    {
        label: '已执行次数',
        name: 'count',
        width: '100px',
    },
    {
        label: '起始时间',
        name: 'start_time',
    },
    {
        label: '截止时间',
        name: 'next_time',
    },
    {
        label: '巡检类型',
        name: 'type_id',
        format: (val) => check_type.dirc[val],
        width: '100px',
    },
    {
        label: '计划状态',
        name: 'plan_state',
        format: (val) => plan_state.dirc[val],
        color: (val) => (val === 1 ? '#4dab72' : val === 2 ? '#878a8d' : '#fbc21b'),
        width: '100px',
    },
    {
        title: '操作',
        name: 'action',
        width: '160',
        buttons: [],
    },
]

export const column1 = [
    {
        label: '工单名称',
        name: 'title',
    },
    {
        label: '是否处理',
        name: 'status',
        format: (val) => is_handled.dirc[val],
        color: (val) => (val == 2 ? '#f85726' : '#0cd9e8'),
        width: '100px',
    },
    {
        label: '处理内容',
        name: 'content',
    },
    {
        label: '告警时间',
        name: 'end_time',
    },
]
